package mtons.cast.modules.controller;

import mtons.cast.modules.data.Result;
import org.springframework.stereotype.Controller;
import org.springframework.ui.ModelMap;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

/**
 * Created by langhsu on 2017/10/13.
 */
@Controller
@RequestMapping("/test")
public class TestController {

    @GetMapping("/json")
    @ResponseBody
    public Result json(){
        return Result.success("test");
    }

    @GetMapping("/welcome")
    public String welcome(ModelMap model){
        model.put("name", "tom");
        return "/welcome";
    }
}
